Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Big Picture APIs. #63

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Support Big Picture APIs. #63

wants to merge 4 commits into from

Conversation

hokein
Copy link
Member

@hokein hokein commented Nov 25, 2015

Fixes #60

After discussing with @patrickklug, currently we have no plan to support steam controller APIs since these APIs are too specific.

This PR exposes the Steam Big Picture APIs:

greenworks.on("gamepad-text-input-dismissed", function(submitted, unsubmittedText) {})

  • submitted Boolean: true if user entered & accepted text (call greenworks.getEnteredGamepadTextInput() for text), false if canceled input.
  • unsubmittedText: Integer

Emits when Steam Big Picture gamepad text input has been closed.

greenworks.showGamepadTextInput(inputMode, inputLineMode, description, charMax, existingText)

  • inputMode: greenworks.GamepadTextInputMode
  • inputLineMode: greenworks.GamepadTextInputLineMode
  • description: String
  • charMax: Integer
  • existingText: String

Activates the Big Picture text input dialog which only supports gamepad input

greenworks.getEnteredGamepadTextLength()

Returns previously entered text's length

greenworks.getEnteredGamepadTextInput(cchText)

  • cchText: Integer

Returns previously entered text

Enum values:

  • greenworks.GamepadTextInputMode.Normal
  • greenworks.GamepadTextInputMode.Password
  • greenworks.GamepadTextInputLineMode.SingleLine
  • greenworks.GamepadTextInputLineMode.MultipleLines

@hokein
Copy link
Member Author

hokein commented Nov 25, 2015

@patrickklug
I haven't test these APIs because I don't have a gamepad device, now I made a prebuilt binary for nw.js 0.8.6 with Steam SDK 1.35 in https://drive.google.com/file/d/0Bx5px5HgHtBxMXdndVpRaXo1NXM/view?usp=sharing
Feel free to test it and report any issue you encounter.

@hokein
Copy link
Member Author

hokein commented Nov 25, 2015

Just for more info.

If anyone who wants to build greenworks for nw.js v0.8.6, he will encounter a call to New is ambiguous compilation error caused by nan v2. The reason is that nw.js v0.8.6 uses a newer v8 version than node v0.10, which nan v2 doesn't support well.

The current workaround is to modify a file in nan. Below shows the way in nan v2.1.0:
Change the line 112 in nan_implementation_pre_12_inl.h to

return v8::FunctionTemplate::New((v8::InvocationCallback)0, data, signature);

@HughIsaacs2
Copy link

Have these APIs been merged into the main Greenworks build yet?

@hokein
Copy link
Member Author

hokein commented Oct 13, 2016

@HughIsaacs2 not yet, since I don't have device to test them...

@HughIsaacs2
Copy link

HughIsaacs2 commented Oct 13, 2016

I don't think you need a gamepad to use the on screen keyboard in Big Picture mode, and even if so I can definitely say it works with any XInput gamepad (I've used it with my Xbox One controller).

So gamepad or not there should be a way to emulate one (there's a ton of Phone to XInput or even keyboard to XInput apps out there).

@cvan
Copy link

cvan commented Mar 2, 2017

hi there, just checking to see the status of this PR. is there anything blocking this from getting merged, any issues that need sorting out first?

@hokein
Copy link
Member Author

hokein commented Mar 3, 2017

@cvan, this PR is kind of outdated, I need to rebase it. Originally this feature was requested by @patrickklug, but he switched to other stuff and didn't get time to play it around.

Do you need this feature? I may pick it up.

@framerate
Copy link

Do you need this feature? I may pick it up.

I think anything to improve this library is important, as more and more games coming down the pipe that will want to use it!

@Canvasfull
Copy link

Hi @hokein Can I used gamepad now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gamepad support
6 participants